function main()
	local block = display.newImage("bottomHalf.png")
	block.y = display.contentHeight - ( block.width / 2 )
	block.staticPosX = block.x
	block.staticPosY = block.y

	block.startTime = 0
	block.elapsedTime = 0
	block.wind = 5
	block.throwPower = 12
	block.throwAngle = 45
	block.gravity = -10
	function block:enterFrame( event )
		if self.x > ( display.contentWidth - ( self.width / 2 ) ) then
			self:stop()
			return
		end

		print( "time : " .. event.time )
		self.elapsedTime = ( event.time - self.startTime ) * 0.001
		print( "time-------- : " .. self.elapsedTime )
		local moveX = ( self.wind * math.pow( self.elapsedTime, 2 ) ) + ( self.elapsedTime * self.throwPower * math.cos( self.throwAngle ) )
		local moveY = ( self.gravity * math.pow( self.elapsedTime, 2 ) ) + ( self.elapsedTime * self.throwPower * math.sin( self.throwAngle ) )
		self.x = self.x + moveX

		if self.y - moveY > self.staticPosY then
			self:stop()
			self.y = self.staticPosY
			return
		end

		self.y = self.y - moveY
	end

	function block:init()
		self.x = self.staticPosX
		self.y = self.staticPosY
		self.elapsedTime = 0
		Runtime:removeEventListener( "enterFrame", self )
	end

	function block:play()
		block:init()
		block.startTime = system.getTimer()
		Runtime:addEventListener( "enterFrame", block )
	end

	function block:stop()
		Runtime:removeEventListener( "enterFrame", self )
	end

	-- Create buttons : from SampleCode - Graphics:MovieClip
	local widget = require( "widget" )
	local onEvent = function( event )
		if ( "press" == event.phase ) then
			print("press")
			block:play()
		end
	end
	local throwButton = widget.newButton{
		onEvent = onEvent,
		id = "Throw",
		label = "Throw",
		fontSize = 24
	}
end

main()
